import { createApp } from 'vue'

import pinia from './stores/store'

import App from './App.vue'
import router from './router'

import './assets/style/main.scss'

import ElementPlus from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import 'dayjs/locale/zh-cn'

import '@/utils/config/windows.config.js'
import '@/utils/config/router.config.js'
import { get, post } from '@/utils/config/axios.config.js'

const app = createApp(App)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.use(pinia)
app.use(router)

app.use(ElementPlus, {
  locale: zhCn,
})

app.config.globalProperties.$get = get
app.config.globalProperties.$post = post

app.mount('#app')
